import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 学生课程作品信息 */
export interface StudentCoursePerformance {
          id: number; // 学生课程作品ID
          teachingId: number; // 授课ID
          studentId?: number; // 学生ID
          attachment: string; // 作品
  }

// 学生课程作品 API
export const StudentCoursePerformanceApi = {
  // 查询学生课程作品分页
  getStudentCoursePerformancePage: async (params: any) => {
    return await request.get({ url: `/train/student-course-performance/page`, params })
  },

  // 查询学生课程作品详情
  getStudentCoursePerformance: async (id: number) => {
    return await request.get({ url: `/train/student-course-performance/get?id=` + id })
  },

  // 新增学生课程作品
  createStudentCoursePerformance: async (data: StudentCoursePerformance) => {
    return await request.post({ url: `/train/student-course-performance/create`, data })
  },

  // 修改学生课程作品
  updateStudentCoursePerformance: async (data: StudentCoursePerformance) => {
    return await request.put({ url: `/train/student-course-performance/update`, data })
  },

  // 删除学生课程作品
  deleteStudentCoursePerformance: async (id: number) => {
    return await request.delete({ url: `/train/student-course-performance/delete?id=` + id })
  },

  /** 批量删除学生课程作品 */
  deleteStudentCoursePerformanceList: async (ids: number[]) => {
    return await request.delete({ url: `/train/student-course-performance/delete-list?ids=${ids.join(',')}` })
  },

  // 导出学生课程作品 Excel
  exportStudentCoursePerformance: async (params) => {
    return await request.download({ url: `/train/student-course-performance/export-excel`, params })
  }
}
